import { defineStore } from "pinia";
import lodash from "lodash";
// 结算管理的筛选项数据
export const testStores = defineStore("test", {
  state: () => ({
    testNum: 0,
    bestAchievement: {
      stepsNumber: 0,
      time: "",
    },
  }),
  getters: {},
  actions: {
    //获取团队类型
    getTestFun() {
      this.testNum += 1;
    },
    getBestAchievement(stepsNumber: any, time: any) {
      if (this.bestAchievement.stepsNumber == 0) {
        this.bestAchievement = {
          stepsNumber,
          time,
        };
      } else {
        if(this.bestAchievement.stepsNumber > stepsNumber) {
          this.bestAchievement = {
            stepsNumber,
            time,
          };
        }
      }
    },
  },
});
